How to Prevent to Deny drop permission of a table for all Users in SQL Server?
How to Prevent to Deny drop permission of a table in SQL Server?
85521-Oct-2021
Updated on 21-Oct-2021
Home / DeveloperSection / Forums / How to Prevent to Deny drop permission of a table in SQL Server?
How to Prevent to Deny drop permission of a table for all Users in SQL Server?
Steilla Mitchel
08-Nov-2021Deny Drop Permission for a Table:
Sometimes cases are generated in that users drop the table from database without informing or by mistake dropped any table then If you want to prevent to drop the table by some user, you can use the following SQL statement ,
The other Deny permission for a user then the following SQL statement is used. First deny the SELECT statement for a particular user.
You also used the following SQL statement for deny the UPDATE table statement for a particular user.
The above SQL statement is used to Deny the drop permission on a particular user.
If you want to restrict on all the user at a time to deny drop permission of all table in your database then you have need to create a DDL Trigger in your database which stop the drop permission of tables. The following SQL statement is used to create a trigger on database to deny the permission,